Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend improvements - BREAKING CHANGES #178

Merged
merged 11 commits into from
Sep 28, 2021
Merged

Conversation

LukeMoll
Copy link
Member

@LukeMoll LukeMoll commented Sep 28, 2021

Headline feature of this PR is moving from the flask CLI interface to a new hacksoc_org one, provided by cli.py and argparse. Having full control over the CLI will allow arguments to be passed during development; chiefly being able to control the markdown implementation as we explore alternatives to the non-commonmark-compliant markdown2.

Other features include:

  • build_datetime() global function to display the datetime at build-time

TODO

  • Re-document CLI and installation process

Testing and migration notes

Recommended to:

  • Delete your venv and create a new one
  • Upgrade pip (pip install --upgrade pip)
  • Install with the new method (pip install -e .)

@LukeMoll LukeMoll added backend Relating to the code which runs on the server and generates the site enhancement labels Sep 28, 2021
@LukeMoll LukeMoll marked this pull request as ready for review September 28, 2021 16:02
@sersorrel
Copy link
Member

$ hacksoc_org --help                                                                                                                                                                                                                    interactive-python3-3.7.10-environment
Traceback (most recent call last):
  File "/nix/store/gk615qkf3hp29h5l9gx0hcmrrjz4sx1z-python3.7-hacksoc_org-1.0.0/bin/.hacksoc_org-wrapped", line 6, in <module>
    from hacksoc_org.cli import main
  File "/nix/store/d6sza42gn3m4l2xkac93ccl3vsl1v57p-python3-3.7.10-env/lib/python3.7/site-packages/hacksoc_org/__init__.py", line 32, in <module>
    with open(path.join(ROOT_DIR, "templates", "context.yaml"), encoding="utf-8") as fd:
FileNotFoundError: [Errno 2] No such file or directory: '/nix/store/d6sza42gn3m4l2xkac93ccl3vsl1v57p-python3-3.7.10-env/lib/python3.7/site-packages/templates/context.yaml'

uh

i realise that nix

however

is this: you need a MANIFEST.in

@sersorrel
Copy link
Member

also: does installing this in editable mode actually work currently? there's no setup.py, and i thought that shouldn't actually work yet: https://setuptools.pypa.io/en/latest/setuptools.html#setup-cfg-only-projects, https://www.python.org/dev/peps/pep-0660/, pypa/pip#8212

adding a setup.py that looks like this is required for me to install it on nix:

from setuptools import setup

setup()

@sersorrel
Copy link
Member

ok ugh
i think the way to solve this is ultimately gonna be to put the templates directory inside hacksoc_org, then stick recursive-include hacksoc_org/templates or similar in a MANIFEST.in
(but i do not know for sure and i don't have brain or really ability to test it, sorry)
python packaging: it is Bad

@LukeMoll
Copy link
Member Author

LukeMoll commented Sep 28, 2021 via email

@LukeMoll
Copy link
Member Author

For development

This works fine with --editable/-e, and there's no sensible use case for installing a non-editable package.

For production

In the future, it could be desirable to run pip install git+https://github.com/hacksoc/hacksoc.org.git on production.

@LukeMoll LukeMoll merged commit 00fbd28 into main Sep 28, 2021
@adambirtles adambirtles deleted the 2021-09-26_backend-features branch August 3, 2022 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Relating to the code which runs on the server and generates the site enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants